package com.tarzan.common.core.utils;

import com.ctrip.framework.apollo.ConfigService;

/**
 * @Package com.tarzan.common.core.utils
 * @Title ApolloPropUtils
 * @Description TODO apollo 配置中心 工具类
 * @Author liujinshan
 * @CreateTime 2021/7/20 9:02
 */
public class ApolloPropUtils {

    public static String getString(String key, String namespace){
        if (StringUtils.isEmpty(key)){
            key = "";
        }
        if (StringUtils.isEmpty(namespace)){
            namespace = "";
        }
        return ConfigService.getConfig(namespace).getProperty(key, null);
    }

    public static String getString(String key){
        if (StringUtils.isEmpty(key)){
            key = "";
        }
        return ConfigService.getAppConfig().getProperty(key,null);
    }
}
